package com.xiegang.apipassenger.controller;

import com.xiegang.apipassenger.Service.ForecastPriceService;
import com.xiegang.internalcommon.dto.ForecastPriceDto;
import com.xiegang.internalcommon.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xieGang
 * @description
 * @date 2023/3/9 20:09
 **/

@RestController
public class ForecastPriceController {

    @Autowired
    private ForecastPriceService forecastPriceService;

    @PostMapping("/forecastPrice")
    public ResponseResult forecastPrice(@RequestBody ForecastPriceDto forecastPriceDto){
        String depLongitude = forecastPriceDto.getDepLongitude();
        String deplatitude = forecastPriceDto.getDeplatitude();
        String destLongitude = forecastPriceDto.getDestLongitude();
        String destLatiude = forecastPriceDto.getDestLatiude();
        String cityCode = forecastPriceDto.getCityCode();
        String vehicleType = forecastPriceDto.getVehicleType();

        return  forecastPriceService.forecastPrice(depLongitude,deplatitude,destLongitude,destLatiude,cityCode,vehicleType);
    }
}
